from django.conf import settings
from django.urls import path
from django.views.generic import ListView

from blog.models import Article
from . import views

app_name = 'blog'
urlpatterns = [
    path('', views.IndexView.as_view(), name='index'),

    path('detail/<pk>', views.ArticleDetailView.as_view(), name='detail'),
    path('comment/<pk>', views.CommentView.as_view(), name='comment'),

    path('search', views.SearchView.as_view(), name='search'),
    path('archive/<year>/<month>', views.ArchiveView.as_view(), name='archive'),
    path('category/<pk>', views.CategoryView.as_view(), name='category'),
    path('tag/<pk>/', views.TagView.as_view(), name='tag'),
]
# path('', ListView.as_view(
#     model=Article, template_name='blog/index.html',
#     paginate_by=settings.PER_PAGE
# ), name='index'),

# path('', views.IndexView.as_view(), name='index'),

# django自带模板语言
# jinja2
# 模板语言的关系
# extends
# block
# include

# 文章目录
# 改造成类视图

# django请求的生命周期
# 请求

# request HttpRequest



# WSGI
